package com.xw.comm.entity;

/**
 * 动作类型
 *
 * @author xiongwei_vendor
 * @date 2021/4/25 17:06
 */
public enum ActionTypeEnum {

    /**
     * 算法类型YOLO的V3、V5版本、fastMaster算法
     */
    YOLO3("yolo3", 3), YOLO5("yol05", 5), MASTER("fastMaster", 1);

    /**
     * 名称
     */
    private String name;

    /**
     * 码
     */
    private Integer code;


    private ActionTypeEnum(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    private void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    private void setCode(Integer code) {
        this.code = code;
    }

    public static ActionTypeEnum build(String name) {
        for (ActionTypeEnum actionTypeEnum : ActionTypeEnum.values()) {
            if (actionTypeEnum.name.equalsIgnoreCase(name)) {
                return actionTypeEnum;
            }
        }
        return YOLO5;
    }


}
